package org.onvivals.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * 账单相关枚举
 */
@Getter
@AllArgsConstructor
public enum BillInfoEnum {

	DEAFUL_ALL(0, "所有"),
	PAY_PRODUCT(1, "消费"),
	RECHAREGE(2, "充值"),
	SIGN_INTEGRAL(3, "签到积分"),
	SYSTEM_ADD(4, "系统添加"),
	SYSTEM_SUB(5, "系统减少");


	private Integer value;
	private String desc;

	public static BillInfoEnum toType(int value) {
		return Stream.of(BillInfoEnum.values())
				.filter(p -> p.value == value)
				.findAny()
				.orElse(null);
	}


}
